<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
	<h1>Fantasy surf</h1>
	
    <div>
        <ul>
            <li><a href="/fb/">Profile</a></li>
            <li><a href="/fb/events/">Competitions</a></li>
            <li><a href="/fb/shop/">Shop</a></li>
        </ul>
    </div>

	{% if wins %}
		
		{% for win in wins %}
			<div>
				You came in <b>{{win.win.place}}</b> at {{win.event.name}}!<br/>   
				<b>improvements:</b>
				stamina: +{{win.win.compensation.stamina}}<br/>
				strength: +{{win.win.compensation.strength}}<br/>
				cash: +${{win.win.compensation.cash}}<br/>
				experience: +{{win.win.compensation.experience}}<br/>
			
				<a href='notifications/{{win.win.id}}/read/' class='notification-read'>ok</a>
			</div>
		{% endfor %}
		
	{% endif %}
	
    <div>
        <h2>My gear</h2>
        <table>
            <tr>
                {% for item in gear %}
                	<td><img src="{{ item.img }}" width="100px" height="100px" /></td>
            	{% endfor %}
            </tr>
            <tr>
            	{% for item in gear %}
        			<td>{{item.name}}</td>
        		{% endfor %}
            </tr>
        </table>    
    </div>

    <div>
        <h2>My stats</h2>
        <b>Level: </b>{{ profile.stats.level }}<br />
        <b>Strength: </b>{{ profile.stats.strength }}<br />
        <b>Stamina: </b>{{ profile.stats.stamina }}<br />
        <b>Fame: </b>{{ profile.stats.fame }}<br />
        <b>Cash: </b>${{ profile.stats.cash }}
    </div>

    <div>
        <h2>Upcoming Events</h2>
        {% if events %}
	        <ul>
	        	{% for event in events %}
	        		<li>{{event.name}}</li>
	        	{% endfor %}
	        </ul>
	        <div><a href="/fb/events/">see all</a></div>
        {% else %}
        	Hey, you are not signed up for any events! <a href="/fb/events/">Sign up</a> and go surfing!
        {% endif %}
    </div>
    
    <script type="text/javascript" src="/static/js/jquery-1.4.2.js"></script>
    
    <script type="text/javascript" >
    
    	$(document).ready(function(){
    		$('.notification-read').each(
    			function(){
    				var ref = $(this).attr('href');
    				$(this).attr('href','#');
    				$(this).click(function(){
    					$(this).parent().hide();
    					$.post(ref, function(data) {
  							alert(':)');
						});
    				});
    			});	
    	});
    
    </script>
        
</body>
</html>
